home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / UTILITIE / CONVERSI / 0825C.ZIP / COM2ASM.DOC < prev    next >
Text File  |  1980-01-01  |  2KB  |  54 lines

  1.     For DOS 2.0 (or later)
  2.  
  3.     My apologies for the presumptuous sounding name of 
  4.     this program.  It doesn't quite do what it sounds
  5.     capable of doing, but it does make the job a bit 
  6.     easier.  
  7.     I use this program whenever I want to convert a 
  8.     COM file to assembler source code, for subsequent
  9.     modification and re-assembly.  Here's how it works:
  10.  
  11.     Get into debug with the COM file you're working
  12.     with, and locate the areas containing the code
  13.     (stay away from the data areas).  Write down the
  14.     starting and ending addresses for all the code
  15.     areas in the file, and quit.
  16.     Back in dos, create a file to be piped into the
  17.     standard input of the debug program, containing
  18.     the commands necessary to unassemble the program.
  19.     The easiest way to do this is to use the copy 
  20.     command. 
  21.  
  22.     A>copy con file1
  23.     u addr1 addr2  <-- unassemble the file
  24.     u addr3 addr4
  25.     .    (etc.)
  26.     .
  27.     q              <-- DON'T FORGET THIS!
  28.     ^Z
  29.  
  30.      1 File(s) copied
  31.  
  32.     A>
  33.     Now, type
  34.     DEBUG (filename).COM  <FILE1  >FILE2
  35.  
  36.     This will (given enough time) generate a file 
  37.     called FILE2 containing the result of the 
  38.     above commands to debug.  Now, run the
  39.     COM2ASM.BAS program, enter FILE2 in response
  40.     to the "Input file?" prompt, and some other
  41.     (new) file name for the output file prompt.
  42.     The program will then read file2, get rid of the
  43.     hex addresses on the left and the op code, 
  44.     label the intra-segment jumps and calls and their
  45.     destinations with labels of the form "Ln",
  46.     where 0<n<999, and send the results to the output
  47.     file.  The result is compatible (as far as it 
  48.     goes) with the macro assembler.
  49.  
  50.  
  51.     Rich Winkel
  52.     Columbia, Mo.
  53.  
  54.